//package org.backend.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.web.SecurityFilterChain;
//
//@Configuration
//@EnableWebSecurity
//public class SecurityConfig {
//
//    @Bean
//    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
//        // 配置关闭csrf机制
//        http.csrf(csrf -> csrf.disable());
//
//        // 配置请求拦截方式
//        http.authorizeHttpRequests(auth -> auth.requestMatchers(
//                        "/user/login",
//                        "/user/register",
//                        "/products/allProList"
//                ).permitAll()
//                .anyRequest().authenticated());
//
//        http.formLogin(form -> form.loginPage("/login"))
//                .login
//
//        return http.build();
//
//
//    }
//}
